import java.util.Random;

public class Demo08 {
    public static void main(String[] args) {
        Random ran = new Random();
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = ran.nextInt(100);
        }
        for (int j = 0; j < arr.length; j++) {
            System.out.print(arr[j] + "  ");
        }
        System.out.println("\n--------------------------------------------------");
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    arr[j] ^= arr[j + 1];
                    arr[j + 1] ^= arr[j];
                    arr[j] ^= arr[j + 1];
                }
            }
        }
        for (int j = 0; j < arr.length; j++) {
            System.out.print(arr[j] + "  ");
        }
    }
}
